﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class adminleft : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		if (Session["UserID"]==null || Session["user"]==null)
		{
			Response.Write("<script>alert('你没有管理员权限，禁止访问！');parent.window.location.href='login.aspx';</script>");
			Response.End();
		}		
		DataSet dsc = Socut.Data.ExecuteDataSet("select * from web_admin where LoginName='" + Session["user"] +"'");
        string[] strqx = dsc.Tables[0].Rows[0][5].ToString().Split(',');

        //Response.Write(strqx);
        //Response.End();

        if (check_class(strqx, "000"))
            m000.Visible = true;
		if (check_class(strqx, "001"))
            m001.Visible = true;
        if (check_class(strqx, "002"))
            m002.Visible = true;
        if (check_class(strqx, "003"))
            m003.Visible = true;
        if (check_class(strqx, "004"))
            m004.Visible = true;
        if (check_class(strqx, "005"))
            m005.Visible = true;
			if (check_class(strqx, "0052"))
            m0052.Visible = true;
			if (check_class(strqx, "0053"))
            m0053.Visible = true;
		if (check_class(strqx, "006"))
            m006.Visible = true;
        if (check_class(strqx, "007"))
            m007.Visible = true;
		if (check_class(strqx, "0072"))
            m0072.Visible = true;
		if (check_class(strqx, "011"))
            m011.Visible = true;
        if (check_class(strqx, "012"))
            m012.Visible = true;
        if (check_class(strqx, "013"))
            m013.Visible = true;
        if (check_class(strqx, "014"))
            m014.Visible = true;
		if (check_class(strqx, "015"))
            m015.Visible = true;
        if (check_class(strqx, "016"))
            m016.Visible = true;
		if (check_class(strqx, "017"))
            m017.Visible = true;
		if (check_class(strqx, "018"))
            m018.Visible = true;
		if (check_class(strqx, "019"))
            m019.Visible = true;
		if (check_class(strqx, "021"))
            m021.Visible = true;
        if (check_class(strqx, "022"))
            m022.Visible = true;
        if (check_class(strqx, "023"))
            m023.Visible = true;
        if (check_class(strqx, "024"))
            m024.Visible = true;
		
    }
   
   		public bool check_class(string[] ksarry, string ksid)
    {
        for (int i = 0; i < ksarry.Length; i++)
        {
            if (ksarry[i] == ksid)
            {
                return true;
            }
        }
        return false;
    }
   
}
